package com.lucky.contract.controller;

import javax.servlet.http.HttpServletRequest;
import com.lucky.contract.entity.SysUser;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

public class BaseController<T> {

	protected SysUser getLoginUser() {
		SysUser loginUser = null;
		try {
			HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
			loginUser = (SysUser)request.getSession().getAttribute("loginPersonId");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return loginUser;
	}
	
}
